/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-07-01
 * Time: 23:44
 */


    /**
     * @Author 12629
     * @Description：
     */

    class MyArray {
        public Object[] array = new Object[10];

        public Object getPos(int pos) {
            return array[pos];
        }

        public void setVal(int pos,Object val) {
            this.array[pos] = val;
        }
    }

    public class Test {

        public static void main(String[] args) {
            MyArray myArray = new MyArray();
            myArray.setVal(0,19);
            myArray.setVal(1,"hello");

            String s = (String)myArray.getPos(1);//强转
            System.out.println(s);

        }
    }

/**
 <T> 标志位： 代表当前类是泛型类
 */


